<template>
	<div class="accountbill">
	   <div class="account" v-for="(item,index) in accountlist" @click="goNext(item.id)">
	      <div class="left">
	      		<p class="type" v-if="item.recordType == 1">充值</p>
	      	    <p class="type" v-else-if="item.recordType == 2">微信支付 </p>
	      	    <p class="type" v-else-if="item.recordType == 3">账户支付</p>
	      	    <p class="type" v-else-if="item.recordType == 4">账户可用金额解冻</p>
	      	    <p class="type" v-else>账户可用金额冻结</p>
	      	    <p class="time">{{item.transactionTime}}</p>
	      </div>
	      <p class="right"><span v-if="item.transactionAmount > 0">+</span><span>{{item.transactionAmount}}</span></p>
	   </div>
	</div>
</template>

<script>export default {
	name: 'accountbill',
	data() {
		return {
			accountlist: {}
		}
	},
	mounted() {
       this.getAccountBill()
	},
	methods: {
		//获取订单明细
		getAccountBill() {
			this.$http.get(this.$store.state.reqUrl + '/customer/account/accountRecord', {}).then(res => {
				if(res.status == 200) {
				 this.accountlist = res.data.list;
				}
			})
		},
		goNext (accountId) {
			this.$router.push({
				path:"/accountinformation",
				 query:{
				 	account_id:accountId
				 }
			});
		}
	}
}
</script>

<style lang="less" scoped> 
    .accountbill{
    	.account{
    		height: 130px;
    		background: #FFFFFF;
    		border-bottom: 1px solid gainsboro;
    		padding: 0 30px;
    		.left{
    			font-size: 34px;
    			margin:20px 0;
    			float: left;
    			.type{
    				color: #000000;
    				font-weight: 800;
    			}
    			.time{
    				font-size: 26px;
    				color: gray;
    			}
    		}
    		.right{
    			float: right;
    			font-size: 38px;
    			color: green;
    			text-align: right;
    			line-height: 60px;
    			margin:20px 0;
    			flex: 1;
    		}
    	}
    }
</style>